package tag20_06_08.lokaleklassen;

abstract class Tier {
	
	static Tier getLieblingstier() {
		class Grottenolm extends Tier {
			public String toString() {
				return "Grottenolm";
			}
			
		} //end of local class 
		
		return new Grottenolm();
	} 
	
	public String toString() {
		return "Ein Tier";
	}
	
} //end of class Tier


public class LokaleKlasseUndLokaleVariablen {

	public static void main(String[] args) {

		Tier t = Tier.getLieblingstier();
		
		System.out.println(t);

	}

}
